﻿using System.Collections;
using System.Collections.Generic;
using Dk;
using UnityEngine;
using UnityEngine.UI;
using  TMPro;
public class BtnImageChange : Dk.IbtnAnim
{
    public Sprite UnSelect; 
    public Sprite OnSelect;
    public TextMeshProUGUI text;
    Image image;
    private void Awake()
    {
        image = GetComponent<Image>();
        text = transform.GetChild(0).GetComponent<TextMeshProUGUI>();
        if(GetComponent<Dk.BaseDkBtn>().isSelect)SelectAct(null);
    }
    public override void SelectAct(BaseDkBtn o)
    {
        image.sprite = OnSelect;
        text.color=Color.yellow;
        
    }

    public override void UnSelectAct(BaseDkBtn o)
    {
        image.sprite = UnSelect;
        text.color = Color.white;
    }
}
